/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.zrnecko.bowlingnumbers.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;

/**
 *
 * @author zrnecko
 */

@Entity
@Name("user")
@Table(name = "user",
	uniqueConstraints=@UniqueConstraint(columnNames="username"))
public class User {

	public User() {}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@NotNull
	@Length(min = 6, max = 15)
	private String username;

	@NotNull
	@Length(min = 6, max = 15)
	private String password;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
